package de.szut.gui.components;

import java.awt.Color;
import java.awt.Font;

import javax.swing.BorderFactory;
import javax.swing.JButton;
import javax.swing.SwingConstants;
import javax.swing.border.Border;

/**
 * A specially designed button generally used in simple programs
 * @author Marc Huisinga
 *
 */
public class StyledButton extends JButton{

	/**
	 * Default border of the button
	 */
	public static final Border BORDER = BorderFactory.createLineBorder(Color.black);
	/**
	 * Default opaqueness of the button
	 */
	public static final boolean OPAQUE = true;
	/**
	 * Default text-alignment of the text on the button
	 */
	public static final int ALIGNMENT = SwingConstants.CENTER;
	/**
	 * Default font of the button
	 */
	public static final Font FONT = new Font("Tahoma", Font.PLAIN, 18);
	/**
	 * Default backgroundcolor of the button
	 */
	public static final Color BACKGROUNDCOLOR = Color.WHITE;
	
	private static final long serialVersionUID = -5483762595610221501L;

	/**
	 * 
	 * @param text - text of the button
	 */
	public StyledButton(String text) {
		super(text);
		styleButton();
	}
	
	public StyledButton() {
		styleButton();
	}
	
	private void styleButton() {
		this.setOpaque(OPAQUE);
		this.setHorizontalAlignment(ALIGNMENT);
		this.setFont(FONT);
		this.setBackground(BACKGROUNDCOLOR);
		this.setBorder(BORDER);
	}
}
